package com.zkh.myutils.io.excel;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerFactory;

/**
 * XML解析工具类
 * @author zkh
 */
public class XMLParseUtils {
	//解析工厂
	private static DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
	//转换工厂
	private static TransformerFactory transformerFactory = TransformerFactory.newInstance();
	
	/**
	 * 获取一个文档构建器
	 */
	public static DocumentBuilder createDocumentBuilder() throws ParserConfigurationException {
		return documentBuilderFactory.newDocumentBuilder();
	}
	
	/**
	 * 创建一个转换器
	 */
	public static Transformer createTransformer() throws TransformerConfigurationException {
		return transformerFactory.newTransformer();
	}
}
